/*
 * Server.h
 *
 *  Created on: 1 mar 2010
 *      Author: hule
 */

#ifndef SERVER_H_
#define SERVER_H_

#include <iostream>
#include <string>
#include <sstream>
#include "SDL/SDL_net.h"
#include <vector>

using namespace std;

class Server {
public:
	Server(int port);

protected:
	int findUser(int host);

	UDPsocket send_socket;
	UDPpacket *send_packet;
	IPaddress host;
	vector<IPaddress> send_packets;

	UDPsocket recv_socket;
	UDPpacket *recv_packet;
	void send(string mess, int user=-1);
	string receive();

};

#endif /* SERVER_H_ */
